package me.landery.modules.sinco.rest;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import me.landery.annotation.AnonymousAccess;
import me.landery.modules.sinco.service.DashboardService;
import me.landery.modules.sinco.service.NewsService;
import me.landery.modules.sinco.service.dto.NewsQueryCriteria;
import me.landery.modules.system.service.UserService;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author cc.w
 * @Date 2022/6/21 20:11
 * @Version 1.0
 */
@RestController
@RequiredArgsConstructor
@Api(tags = "Sinco：主页面管理")
@RequestMapping("/sinco/dashboard")
public class DashboardController {

    private final DashboardService dashboardService;

    @ApiOperation("获取主页面需要的数据")
    @AnonymousAccess
    @GetMapping
    public ResponseEntity<Object> queryAllData(){
        return new ResponseEntity<>(dashboardService.getAllPanelData(), HttpStatus.OK);
    }
}
